package ciyuan.Gui.Particle;

import net.minecraft.client.particle.IAnimatedSprite;
import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.world.ClientWorld;

public class DamageParticleFactory implements IParticleFactory<DamageParticleData> {

    private final IAnimatedSprite sprites;

    public DamageParticleFactory(IAnimatedSprite sprite) {
        this.sprites = sprite;
    }

    @Override
    public Particle createParticle(DamageParticleData typeIn, ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
        DamageParticle particle = new DamageParticle(worldIn, x, y, z, typeIn.getSpeed(),typeIn.getCount(),typeIn.getDamageType());
        particle.pickSprite(sprites);
        return particle;
    }

}
